1. Field of the Invention
The present invention relates to the field of computer graphics and, in particular, to techniques for lighting objects in a computer-generated graphics scene.
2. Description of the Related Art
It is common for video games to pre-compute the static or diffuse lighting for three-dimensional (3D) scene geometry. The pre-computed lighting data is then used to light elements of the scene geometry at runtime (i.e., when the video game is played). This approach separates the lighting used for static elements of the scene from the lighting of dynamic elements, such as characters.
One common type of light source is used to light dynamic elements of scene geometry is a disk light source. And disk light sources have been used in interactive rendering. However, one commonly used approximation for the irradiance of a receiver point lit by a disk light source turns out to have a high error when the point is near the light source. This common approximation is given by:
            cos      ⁡              (        θ        )              ⁢          cos      ⁡              (        α        )              ⁢          r      2                  r      2        +          d      2      where r is the radius of the disk, d is the distance from the center of the disk light source to the receiver point, the angle θ is measured between the normal of the disk light source and the vector from the center of the disk to the receiver point, and an angle alpha α is measured between the vector from the center of the disk to the receiver point and the normal of the receiver point. The common approximation yields a value of zero (i.e., of no irradiance) whenever the angle between the normal of the receiver point and the vector to the center of the disk is ninety degrees, regardless of the distance from the disk light source, which is clearly incorrect.
A more accurate approach for determining the irradiance of a receiver point at a disk light source would be to analytically compute the irradiance for the light source for any given receiver point, based on the normal at that receiver point. However, doing so would require the use of a four or five dimensional lookup table at runtime, which is impractical for current systems.